import './assets/css/main.css'

import {
  createApp
} from 'vue'
import {
  createPinia
} from 'pinia'

// DataV配置不成功，局部引入也不行，目前只想到用组件注入
// import * as DataV from '@dataview/datav-vue3'
// app.use(DataV, { classNamePrefix: 'dv-' })
// import * as DataV from '@dataview/datav-vue3'

import DataVVue3 from '@kjgl77/datav-vue3'
import vue3SeamlessScroll from "vue3-seamless-scroll";

import SvgIcon from '@/components/common/svgIcon/index.vue'
import '@/assets/iconfont/iconfont.js'
import '@/assets/iconfont/iconfont.css'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

import App from './App.vue'
import router from './router/index'

import http from '@/utils/request'
window.$http = http

import registerGolbalComponents from './components/common'

const app = createApp(App)
app.use(createPinia())
app.use(router)

registerGolbalComponents(app)

// 只能注入部分DataV组件（边框、修饰、loading）
// Object.keys(DataV).forEach((name) => {
//   if (name !== 'setClassNamePrefix') {
//     const comp = DataV[name]
//     app.component(`Dv${name}`, comp)
//   }
// })
app.use(DataVVue3)
app.use(ElementPlus)
app.use(vue3SeamlessScroll);

// 注入 iconfont 组件
app.component('SvgIcon', SvgIcon)

app.mount('#app')